#ifndef __CHUNKCACHEPROVIDER__
#define __CHUNKCACHEPROVIDER__

#include "IProvideCaching.h"
#include "..\Math\Point2.h"

#include <wx\string.h>
#include <wx\filename.h>

class RenderListBase;

class ChunkCacheProvider : public IProvideCaching
{
	Point2i _chunk;
	wxString _str;

public:
	ChunkCacheProvider(const Point2i &chunk) :
		_chunk(chunk),
		_str(wxString("temp/chunk_") << chunk.X << "_" << chunk.Y)
	{
		wxFileName tempDir("temp/");

		if (!tempDir.DirExists())
			tempDir.Mkdir(511, wxPATH_MKDIR_FULL);
	}

	void Load(const int &index, RenderListBase *list);
	void Save(const int &index, const RenderListBase *list);
};

#endif